home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / demos / VisualAge for Java 2.0 Entry / setup / data1.cab / ide-e / IDE / cache / ZTE55Y (.txt) < prev    next >
Encoding:
Java Class File  |  1998-09-16  |  1.8 KB  |  52 lines

  1. package com.sun.java.swing.plaf.basic;
  2.  
  3. import com.sun.java.swing.Timer;
  4. import java.awt.event.ActionEvent;
  5. import java.awt.event.ActionListener;
  6. import java.io.Serializable;
  7. import java.util.EventObject;
  8.  
  9. public class BasicSliderUI$ScrollListener implements ActionListener, Serializable {
  10.    // $FF: synthetic field
  11.    BasicSliderUI this$0;
  12.    int direction;
  13.    boolean useBlockIncrement;
  14.  
  15.    // $FF: synthetic method
  16.    public BasicSliderUI$ScrollListener(BasicSliderUI this$0) {
  17.       this.this$0 = this$0;
  18.       this.direction = 1;
  19.       this.direction = 1;
  20.       this.useBlockIncrement = true;
  21.    }
  22.  
  23.    // $FF: synthetic method
  24.    public BasicSliderUI$ScrollListener(BasicSliderUI this$0, int dir, boolean block) {
  25.       this.this$0 = this$0;
  26.       this.direction = 1;
  27.       this.direction = dir;
  28.       this.useBlockIncrement = block;
  29.    }
  30.  
  31.    public void setDirection(int direction) {
  32.       this.direction = direction;
  33.    }
  34.  
  35.    public void setScrollByBlock(boolean block) {
  36.       this.useBlockIncrement = block;
  37.    }
  38.  
  39.    public void actionPerformed(ActionEvent e) {
  40.       if (this.useBlockIncrement) {
  41.          this.this$0.scrollByBlock(this.direction);
  42.       } else {
  43.          this.this$0.scrollByUnit(this.direction);
  44.       }
  45.  
  46.       if (!BasicSliderUI.access$trackListener(this.this$0).shouldScroll(this.direction)) {
  47.          ((Timer)((EventObject)e).getSource()).stop();
  48.       }
  49.  
  50.    }
  51. }
  52.